package com.thiswhyme.openfeign.client.feign;

import com.thiswhyme.common.response.ResponseVo;
import com.thiswhyme.openfeign.client.feign.dto.BaseDto;
import com.thiswhyme.openfeign.client.feign.dto.Status;
import com.thiswhyme.openfeign.client.feign.dto.StudentDto;
import com.thiswhyme.openfeign.gson.adapter.requestparam.RequestParamConverter;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created by thiswhyme on 2020/8/16.
 */
@FeignClient("openfeign-server")
public interface UserFeignService {

    @PostMapping("/openfeign/user/user-list")
    ResponseVo<BaseDto> listUsers(@RequestBody StudentDto req);

    @PostMapping("/openfeign/user/user-list2")
    ResponseVo<BaseDto> listUsers2(@RequestBody StudentDto req, @RequestParam("id") Long id);

    @PostMapping("/openfeign/user/user-info")
    ResponseVo<BaseDto> queryUserInfo(@RequestParamConverter @RequestParam("student") StudentDto student);

    @GetMapping("/openfeign/user/user-status")
    ResponseVo<Status> queryUserStatus(@RequestParam("status") Status status);
}
